package com.ruoyi.wechat.api;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

/**
 * SHA1加密算法
 */
public class SHA1{
	
	public static String SHA1Encode(String origin){
		String resultString = null;
		try {
			MessageDigest md = MessageDigest.getInstance("SHA-1");
			resultString = MD5.byteArrayToHexString(md.digest(origin.getBytes()));
		} catch (NoSuchAlgorithmException e) {
			e.printStackTrace();
		}
		return resultString;
	}
	
	public static void main(String[] args) {
		System.out.println(SHA1Encode("g"));
	}
}
